﻿using System.Activities;
using Microsoft.TeamFoundation.Build.Client;

namespace TransformConfig.Workflow
{
    [BuildActivity(HostEnvironmentOption.Agent)]
    public sealed class TransformConfigActivity : CodeActivity
    {
        public InArgument<string> Source { get; set; }
        public InArgument<string> Transform { get; set; }
        public InArgument<string> Output { get; set; }

        protected override void Execute(CodeActivityContext context)
        {
            // Obtain the runtime value of the Text input argument
            var source = context.GetValue(Source);
            var transform = context.GetValue(Transform);
            var output = context.GetValue(Output);

            Transformation.PerformTransform(source, transform, output);
        }
    }
}
